package com.zhny.sensor.service;

import com.zhny.sensor.dao.BarcodeMachineRepository;
import com.zhny.sensor.entity.BarcodeMachine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @Auther: zhy
 * @Date: 2019/11/15
 * @Description: 脚标机设备管理服务
 */
@Service
public class BarcodeMachineService {

    @Autowired
    private BarcodeMachineRepository barcodeMachineRespontity;

    /**
     * 根据脚标编号查询脚标机设备
     * @param number
     * @return BarcodeMachine
     */
    public Optional<BarcodeMachine> findByNumber(String number) {
        return Optional.ofNullable(barcodeMachineRespontity.findByNumber(number).get(0));
    }



}
